var AppLog = {
	init: function(){
		var boss = this;
		
		boss.initLayout();
		boss.initEvent();
	},
	initLayout: function(){
		var boss = this;
		
		$("#startdate, #stopdate").datetimepicker();
		boss.initGrid();
	},
	initEvent: function(){
		var boss = this;
		
		$("#searchBtn").bind("click", function(){
			boss.initGrid();
		});
	},
	initGrid: function(){
		var boss = this;
		
		var data = sbl.getFormData("AppLog_div");
		CardGrid.grid({
			url: burl + "/AppLog/getAppLogList.do",
			Data: data,
			columns:{
				img:"img",
				title:"uname",
				row1:["loginname,登录名","createTime,创建时间","version,版本","os,系统"],
				row2:["model,手机模块","cpu,cup架构","vendor,厂商"],
				row3:["version"],
				todo:"todo"
			},
			OnRender: function(data){
				data.img = "http://a.pic1.ajkimg.com/display/anjuke/dd0bac0fff6193dc579a090f34e408a5/240x180c.jpg";
				data.todo = "<a tag='information' no='" + data.log + "'>详情</a>";
				return data;
			},
			OnComplete: function(){
				$("a[tag='information']").bind("click", function(){
					var log = $(this).attr("no");
					sbl.dialog({
						width: 700,
						height: 500,
						contentDivId: "logDialog",
						OnComplete: function(){
							var htmlContent = "<div class='CommonPanel'><table><tr>";
							htmlContent += "<td class='input'><div>" + log + "</div></td></tr></table>";
							$("#logDialog").html(htmlContent);
						}
					});
				});
			}
		}, "applog_grid");
	}
};
$(function(){
	AppLog.init();
});